home *** CD-ROM | disk | FTP | other *** search
- Path: ibm32.perftech.com!usenet
- From: murf@perftech.com (John Murphy)
- Newsgroups: comp.lang.c++,comp.os.msdos.programmer
- Subject: Re: Timer (0x1C) Interrupt exactly 18.2 seconds?
- Date: 26 Feb 1996 23:48:00 GMT
- Organization: Performance Technology Inc
- Message-ID: <4gtgrg$k20@ibm32.perftech.com>
- References: <4givrv$cim@midland.co.nz> <Dn9FMB.19s.0.sheppard@torfree.net> <448372328wnr@fatphil.demon.co.uk>
- NNTP-Posting-Host: k5zba.perftech.com
- Mime-Version: 1.0
- NNTP-Posting-User: REVCO
- X-Newsreader: WinVN 0.93.11
-
- In article <448372328wnr@fatphil.demon.co.uk>, Phil@fatphil.demon.co.uk
- says...
- >
- >In article: <Dn9FMB.19s.0.sheppard@torfree.net> ak892@torfree.net (Bruce
- DeVisser) writes:
- >>
- >> Jarrod S Lowe (lowefam@igrin.co.nz) wrote:
- >> : Hi
- >>
- >> : I have a C++ Program (on DOS) in which a function is attached to the
- >> : Timer (0x1C) Interrupt.
- >>
- >> : [snip]
- >>
- >> : This program is expected to run, continually, for YEARS - so a drift
- >> : that shows up in 5 minutes will make it unusable.
- >>
- >> : Does anybody have any ideas WHY this is happening?
- >>
- >> Yes; because the timer is not exactly 18.2 Hz. Try taking the oscillator
- >> frequency -- 1.19318 MHz (which may drift slightly, so don't get too
- >> carried away with precision), dividing it by 65536, and see what you come
- >> up with.
- >>
- >> Bruce DeVisser
- >
- >This comes from the asm.x86 group, where we've just had a similar
- >discussion
- >
- >
- >In article: <3124955A.2EF1@hda.hydro.com> Terje Mathisen
- ><Terje.Mathisen@hda.hydro.com> writes:
- >> Here's another way to translate the 18.206...Hz ticks into
- >> seconds: Multiply the ticks by the ratio 1913/34829 =
- >> 18.20648196.
- >>
- >> This is the closest possible 16-bit only rational approximation
- >> to the true value, it is probably more accurate than the clock
- >> frequency of most PCs, so there's no need to try to improve upon
- >> it.
- >
- >Sorry Terje,
- >I beg to differ in the 8th significant digit!!
- [snip]
- Just as a point of interest, the ratio used internally by DOS is
- 298295/16384.
-
- Murf
-
-